﻿@{
	ViewBag.Title = "Traditional Paging (+Twitter Bootstrap)";
}
@using PagedList;
@using PagedList.Mvc;

<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">

<h2>PagedList.Mvc.Example Website : Twitter Bootstrap</h2>

<h3>Instructions:</h3>
<p>Simply remove the PagedList stylesheet:</p>
<pre>&lt;link href="/Content/PagedList.css" rel="stylesheet" type="text/css" /&gt;</pre>
<p>... and add the <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a> stylesheet:</p>
<pre>&lt;link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"&gt;</pre>

<h3>Example of paging a list:</h3>

@Html.PagedListGoToPageForm((IPagedList)ViewBag.Names, Url.Action("Index"))

<h3>List of @ViewBag.Names.TotalItemCount Names (Page Size: @ViewBag.Names.PageSize, Current Page: @ViewBag.Names.PageNumber)</h3>
<ol start="@ViewBag.Names.FirstItemOnPage">
	@foreach(var i in ViewBag.Names){
		<li>@i</li>
	}
</ol>

<h2>Out-of-the-box Pager Configurations</h2>

<h3>Default Paging Control</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }))

<h3>Default Paging Control (+First and Last)</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.DefaultPlusFirstAndLast)

<h3>Minimal Paging Control</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.Minimal)

<h3>Minimal Paging Control w/ Page Count Text</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.MinimalWithPageCountText)

<h3>Minimal Paging Control w/ Item Count Text</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.MinimalWithItemCountText)

<h3>Page Numbers Only</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.PageNumbersOnly)

<h3>Only Show Five Pages At A Time</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), PagedListRenderOptions.OnlyShowFivePagesAtATime)

<h2>Custom Pager Configurations</h2>

<h3>Custom Wording (<em>Spanish Translation Example</em>)</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), new PagedListRenderOptions { LinkToFirstPageFormat = "<< Primera", LinkToPreviousPageFormat = "< Anterior", LinkToNextPageFormat = "Siguiente >", LinkToLastPageFormat = "Última >>" })

<h3>Show Range of Items For Each Page</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), new PagedListRenderOptions { FunctionToDisplayEachPageNumber = page => ((page - 1) * ViewBag.Names.PageSize + 1).ToString() + "-" + (((page - 1) * ViewBag.Names.PageSize) + ViewBag.Names.PageSize).ToString(), MaximumPageNumbersToDisplay = 5 })

<h3>With Delimiter</h3>
@Html.PagedListPager((IPagedList)ViewBag.Names, page => Url.Action("Index", new { page }), new PagedListRenderOptions { DelimiterBetweenPageNumbers = "|" })

<h3>Empty PagedList</h3>
@Html.PagedListPager(new string[0].ToPagedList(1, 10), page => Url.Action("Index", new { page }))